home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10183 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: in-news.erinet.com!usenet
  2. From: timb@erinet.com (Tim Berens)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: malloc question
  5. Date: Sat, 16 Mar 1996 02:51:35 GMT
  6. Organization: EriNet Online 513 436-9915
  7. Message-ID: <4ict59$q3m@eri2.erinet.com>
  8. References: <4htonk$350@news.hklink.net> <danpop.826488975@rscernix> <4i44vk$g16@rigel.rz.uni-ulm.de>
  9. NNTP-Posting-Host: edlp106.erinet.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. peinel@faw.uni-ulm.de (Gertraud Peinel) wrote:
  13.  
  14.  
  15.  
  16. >Hmmm, and what should I do with this (especially when I have to use these
  17. >compilers) ? :
  18.  
  19. >  sun5:/users/peinel/clang(36)> uname -a
  20. >  SunOS sun5 4.1.3 3 sun4c
  21. >  sun5:/users/peinel/clang(35)> cat oh.c 
  22. >  #include <stdlib.h>
  23.  
  24. >  typedef struct item {
  25. >    int val;
  26. >    struct item *next;
  27. >  } ITEM, *PITEM;
  28.  
  29. >  main()
  30. >  {
  31. >    PITEM head, current;
  32. >    head= malloc(sizeof(ITEM));
  33. >    head->val=1;
  34. >  }
  35. >  sun5:/users/peinel/clang(29)> cc oh.c
  36. >  "oh.c", line 11: warning: illegal pointer combination
  37. >  sun5:/users/peinel/clang(34)> which cc
  38. >  /bin/cc
  39. >  sun5:/users/peinel/clang(32)> CC oh.c
  40. >  CC  mist.c:
  41. >  "oh.c", line 11: error: no standard conversion of  char * to  struct item *
  42. >  "oh.c", line 10: warning:  current not used
  43. >  1 error
  44. >  sun5:/users/peinel/clang(33)> which CC
  45. >  /com/owc++/bin/CC
  46.  
  47. >Without casting ?
  48.  
  49. >`gp'
  50.  
  51. gp:
  52.  
  53.     How dare you introduce commercial reality into a discussion of
  54. software development?  Don't you know that all you have to do is tell
  55. each of your supervisors all the way up the line to forget corporate
  56. policy and change compilers?  If it's your customers who insist you
  57. work with these substandard (even barbaric!) compilers, tell them to
  58. kiss your butt.  Just go get some new customers who will let you use
  59. the compiler of your choice.  
  60.  
  61.     Or you could just shrug your shoulders and use the cast.
  62.  
  63. Tim
  64.  
  65.  
  66.